#include "tools.h"

// 向上取整
// such as :
// 3.14 -> 4
// -0.618 -> -1
int Rounded_up(double x){
    if(x>=0){
        if(x>(int)x){
            return (int)x+1;
        }else{
            return (int)x;
        }
    }else{
        if(x<(int)x){
            return (int)x-1;
        }else{
            return (int)x;
        }
    }
}